package com.example.dy.pay.service.feign;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.example.dayu521.OrRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@FeignClient("sg-oss/trade")
public interface ProductTradeSgOss {

    @Data
    final class Trade{
        private Integer bs_state;
        private BigDecimal sum_money;
        private LocalDateTime timeout_date;  //绝对时间截止日期
    }

    @PostMapping("/get_order2")
    OrRes<Trade> get_order(@RequestBody Long order_id);

    @Data
    @AllArgsConstructor
    final class FinishTrade{
        private String order_no;
        private String order_state;
    }
    @PostMapping("/order/finish_pay")
    OrRes<?> finish_pay(@RequestBody FinishTrade finishTrade);
}
